<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
	<title>秒批额度 极速下款</title>
	<link href="/layui/css/layui.css" rel="stylesheet"/>
	<style>
		*{
			margin: 0;
			padding: 0;
			box-sizing: border-box;
		}
		html,body{
			width: 100%;
			height: 100%;
		}
		body{
			max-width: 640px;
			min-width: 320px;
			overflow-x: hidden;
			margin: 0 auto; 
		}
		.clearfix:after {
			content: "";
			display: block;
			visibility: hidden;
			height: 0;
			clear: both;
		}
		.clearfix {
			zoom: 1;
		}
		.main{
			width: 100%;
			height: 100%;
			padding-bottom: 1.4rem;
			background: url(../../html/daikuan/img/bg.jpg) no-repeat;
			-webkit-background-size: cover;
			background-size: cover;
		}
		.item-wrap{
			padding-top: 11.8rem;
		}
		.item-list{
			display: block;
			height: 2.8rem;
			width: 90%;
			background: url(../../html/daikuan/img/text-bg.png) no-repeat;
			-webkit-background-size: 100% 100%;
			background-size: 100% 100%;
			margin: 0 auto 0.4rem;
			cursor: pointer;
			padding: 0.35rem 0.8rem 0.45rem 0.8rem;
		}
		.logo,.text{
			display: block;
			float: left;
		}
		.logo{
			width: 2rem;
			height: 2rem;
		}
		.text{
			width: calc(100% - 2rem);
			color: #fff;
			padding-left: 0.4rem;
			font-size: 0.55rem;
		}
		img{
			width: 100%;
		}
		h2{
			font-size: 0.8rem;
			font-weight: normal;
		}
		.msg-tips{
			width: 70%;
			position: absolute;
			top: 50%;
			left: 50%;
			-webkit-transform: translate(-50%,-60%);
			-moz-transform: translate(-50%,-60%);
			-ms-transform: translate(-50%,-60%);
			transform: translate(-50%,-60%);
			background: #fff;
			color: #333;
			display: none;
			z-index: 4;
		}
		.msg-tips-title{
			padding: 0 0.8rem 0 0.2rem;
		    height: 42px;
		    line-height: 42px;
		    border-bottom: 1px solid #eee;
		    font-size: 14px;
		    color: #333;
		    overflow: hidden;
		    background-color: rgba(53, 178, 74, 0.69);
		    border-radius: 2px 2px 0 0;
		}
		.msg-tips-main{
			padding:  0.3rem;
		}
		.msg-tips-main span{
			font-size: 12px;
		}
		.msg-tips-main input{
			border: 1px solid #ccc;
			height: 1rem;
			padding: 0 8px;
			box-sizing: border-box;
			width: calc(100% - 5em);
		}
		.btn-submit{
			padding: 10px;
			text-align: center;
		}
		.btn-submit button{
			width: 50%;
			height: 28px;
		    line-height: 28px;
		    padding: 0 15px;
		    border: 1px solid #dedede;
		    background-color: #f1f1f1;
		    border-radius: 2px;
		    cursor: pointer;
		    margin-bottom: 5px;
		}
		.msg-tips-close{
			position: absolute;
			top: 7px;
			right: 10px;
			cursor: pointer;
			font-size: 18px;
		}
		.msg-tips-close:before{
			content: '\2715 ';
		}
	</style>
	<script type="text/javascript">
	        var oHtml = document.documentElement;
	        getFont();
	        window.onresize = function(){getFont();}
	        function getFont(){
	        	var screenWidth = oHtml.clientWidth;
	            if(screenWidth <= 320){

	                oHtml.style.fontSize = '23.7037px';
	            }else if(screenWidth >= 640){

	                oHtml.style.fontSize = '47.4074px';
	            }else{
	            	oHtml.style.fontSize = screenWidth/(540/40)+'px'; 
	            }  	
	        }
        </script>
</head>
<body>
	<div class="main">
		<div class="item-wrap">
			<?php if ($data) : ?>
            <?php foreach ($data as $key => $val) : ?>
			<a class="item-list" href="javascript:;" onclick="redirectTo('<?php e($val->link); ?>')">
				<span class="logo">
					<img src="<?php e($val->absolute_url); ?>" alt="">
				</span>
				<span class="text">
					<h2><?php e($val->name); ?></h2>
					<span><?php e($val->desc); ?></span>
				</span>
			</a>
			<?php endforeach; ?>
            <?php endif; ?>
		</div>
	</div>
	<script src="/assets/js/building/jquery-1.11.1.min.js"></script>
	<script src="/layui/lay/dest/layui.all.js"></script>
	<script src="/layui/custom.js"></script>
	<script>
		var isLogin = "<?php echo $isLogin;?>";
		function redirectTo(url){
			if(isLogin == "" || undefined || 0 ){
//				$('.msg-tips').fadeIn();
				$.popPage({
					url: '/Activity/tanchuang',
					title: "登录",
					data:{}
				},
				{
					height:$(window).height()
				});
			}else{
				window.location.href = url;
			}
		}
		$(document).on('click','.btn-close',function(){
			$(this).parents('.msg-tips').fadeOut();
		})

		$(".btn-submit").click(function(){
			var mobile = $("#mobile").val();
			if (mobile == "") {
				alert("手机号不能为空！");
				return false;
			}else if(mobile != ""){
				var reg = /^1[34578]\d{9}$/;
				if(!reg.test(mobile)){
					alert("请输入正确的手机号码！");
					return false;
				}
			}
			var url = "/Activity/jrLogin";
			$.ajax({
				type: "get",        //数据提交的方式(get/post)
				url: url,            //数据提交请求的页面
				dataType:"json",
				data: {              //提交的参数
					'mobile':mobile
				},
				//回调函数
				success: function(rst){
					console.log(rst);
					if(rst.status == "ok"){
						window.location.href = window.location.href;
					}else{
						isLogin = 0;
					}
				}
			});
		});


	</script>
</body>
</html>